package com.geqian.structure.pojo;

import com.geqian.structure.db.DatabaseColumn;
import lombok.Data;

/**
 * 数据库连接信息
 * @author geqian
 * @date 12:55 2023/7/12
 */
@Data
public class DatabaseInfo {
    private String driverClass;
    private String urlPrefix;
    private String urlSuffix;

    private DatabaseColumn tableColumn;
    private String databases;
    private String tables;
    private String tableInfo;
    private String detailedTableStructure;
    private String simpleTableStructure;


    public String getUrl(String ip, int port) {
        return urlPrefix + ip + ":" + port + urlSuffix;
    }

    public void appendUrlSuffix(String database){
        this.urlSuffix = this.urlSuffix.replace("${database}",database);
    }
}
